<!--suppress ALL -->
<include file="./Template/header.html" />

<link rel="stylesheet" type="text/css" href="/Template/css/exam.css?v=1">
<link rel="stylesheet" type="text/css" href="/Template/css/checkbox.css">
<script type="text/javascript" src="/Template/js/amazeui.js"></script>
<script type="text/javascript" src="/Template/js/jquery.checkbox.js"></script>
<script type="text/javascript">


    $(function() {

        //初始化页面配置
        initPage("脊柱侧凸检查测量");

        var app = new Vue({
            el: '#container',
            data: {
            },
            methods: {
                checkRole: function(employeeRoleId, roleId) {
                    var employeeRoleArr = employeeRoleId.split(",");
                    var roleArr = roleId.split(",");

                    var result = false;
                    $.each(roleArr, function(i,val){
                        if($.inArray(val, employeeRoleArr) != -1 || $.inArray((parseInt(val)+100).toString(), employeeRoleArr) != -1){
                            result = true;
                        }
                    });
                    return result;
                },
                cancel: function() {
                    window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                },
                save: function() {

                    var examMeasureId = $("input[name=examMeasureId]").val();
                    var workorderId = $("input[name=workorderId]").val();

                    var pose = $("select[name=pose]").val();
                    var em0 = $("input[name=em0]").val();
                    var em1 = $("input[name=em1]").val();
                    var em2 = $("input[name=em2]").val();
                    var em3 = $("input[name=em3]").val();
                    var em4 = $("input[name=em4]").val();
                    var em5 = $("input[name=em5]").val();
                    var em6 = $("input[name=em6]").val();
                    var em7 = $("input[name=em7]").val();
                    var em8 = $("input[name=em8]").val();
                    var em9 = $("input[name=em9]").val();
                    var em10 = $("input[name=em10]").val();
                    var em11 = $("input[name=em11]").val();
                    var em12 = $("input[name=em12]").val();
                    var em13 = $("input[name=em13]").val();
                    var em14 = $("input[name=em14]").val();
                    var em15 = $("input[name=em15]").val();
                    var em16 = $("input[name=em16]").val();
                    var em17 = $("input[name=em17]").val();
                    var em18 = $("input[name=em18]").val();
                    var em19 = $("input[name=em19]").val();
                    var em20 = $("input[name=em20]").val();
                    var em21 = $("input[name=em21]").val();
                    var em22 = $("input[name=em22]").val();
                    var em23 = $("select[name=em23]").val();
                    var em24 = $("input[name=em24]").val();
                    var em25 = $("select[name=em25]").val();
                    var em26 = $("input[name=em26]").val();
                    var em27 = $("select[name=em27]").val();
                    var em28 = $("input[name=em28]").val();
                    var em29 = $("select[name=em29]").val();
                    var em30 = $("input[name=em30]").val();
                    var em31 = $("select[name=em31]").val();
                    var em32 = $("input[name=em32]").val();
                    var em33 = $("select[name=em33]").val();
                    var em34 = $("input[name=em34]").val();
                    var em35 = $("select[name=em35]").val();
                    var em36 = $("input[name=em36]").val();
                    var em37 = $("select[name=em37]").val();
                    var em38 = $("input[name=em38]").val();
                    var other = $("textarea[name=other]").val().replace(/[\r\n]/g,"");
                    var note = $("textarea[name=note]").val().replace(/[\r\n]/g,"");

                    var completed = "1";
                    if(isNullOrEmpty(em0
                            && em1
                            && em2
                            && em3
                            && em4
                            && em5
                            && em6
                            && em7
                            && em8
                            && em9
                            && em10
                            && em11
                            && em12
                            && em13
                            && em14
                            && em15
                            && em16
                            && em17
                            && em18
                            && em19
                            && em20
                            && em31
                            && em32
                            && em33
                            && em34
                            && em35
                            && em36
                            && em37
                            && em38
                            && pose
                            && note
                            && other
                        )) {
                        completed = "-1";
                    }
                    if(isNullOrEmpty(pose)) {
                        alert("未选择【测量姿态】");
                        return false;
                    }

                    $.ajax({
                        url:"/wechat/workorder/examMeasureScoPost",
                        type:"post",
                        data:{
                            examMeasureId: examMeasureId,
                            workorderId: workorderId,
                            pose: pose,
                            em0: em0,
                            em1: em1,
                            em2: em2,
                            em3: em3,
                            em4: em4,
                            em5: em5,
                            em6: em6,
                            em7: em7,
                            em8: em8,
                            em9: em9,
                            em10: em10,
                            em11: em11,
                            em12: em12,
                            em13: em13,
                            em14: em14,
                            em15: em15,
                            em16: em16,
                            em17: em17,
                            em18: em18,
                            em19: em19,
                            em20: em20,
                            em21: em21,
                            em22: em22,
                            em23: em23,
                            em24: em24,
                            em25: em25,
                            em26: em26,
                            em27: em27,
                            em28: em28,
                            em29: em29,
                            em30: em30,
                            em31: em31,
                            em32: em32,
                            em33: em33,
                            em34: em34,
                            em35: em35,
                            em36: em36,
                            em37: em37,
                            em38: em38,
                            other: other,
                            note: note,
                            completed:completed,
                        },
                        dataType:"JSON",
                        beforefootSend:function(){
                            $("#loadingToast").show();
                        },
                        complete:function(){
                            $('#loadingToast').hide();
                        },
                        success:function(data){
                            if(data.code == 200) {
//                                alert(data.alert);
                                alert("保存成功");
                                window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                            }
                        },
                    })

                }
            }
        })
        $(".item select").change(function() {
            var value = $(this).find("option:selected").text();
            $(this).prev().val(value);
        });
    })



</script>

<div class="container" id="container">
    <div class="hint-info">
        <span class="update_time">{$formDict.update_time}：{$examMeasure.update_time}</span>
        <span class="employee_name">{$formDict.update_name}：{$employeeName}</span>
    </div>
    <div class="bg">
        <img class="bg-img" src="http://xwk-file.oss-cn-qingdao.aliyuncs.com/Home/1exam_TLSO_wechat.jpg" alt="bg">
    </div>
    <div class="edit-info">
        <div class="edit-content">
            <input type="text" style="display: none;" name="workorderId" value="{$workorderId}">
            <input type="text" style="display: none;" name="examMeasureId" value="{$examMeasureId}">
            <div class="item">
                <span>测量姿态：</span>
                <input id="pose" type="text" value="{$examMeasure.pose}" readonly placeholder="请选择">
                <select name="pose">
                    <option value="{$examMeasure.pose}">请选择</option>
                    {:getFormDictSelectOption($examMeasure['pose'],'pose','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 30%">—— 围长 ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px"><span>1.围长:</span><input name="em0" type="text" value="{$examMeasure.em0}" placeholder="腋窝(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>2.围长:</span><input name="em1" type="text" value="{$examMeasure.em1}" placeholder="乳头连线(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>3.围长:</span><input name="em2" type="text" value="{$examMeasure.em2}" placeholder="剑突(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>4.围长:</span><input name="em3" type="text" value="{$examMeasure.em3}" placeholder="肋骨下沿(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>5.围长:</span><input name="em4" type="text" value="{$examMeasure.em4}" placeholder="腰部(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>6.围长:</span><input name="em5" type="text" value="{$examMeasure.em5}" placeholder="髂前上棘(mm)" ></div>
            <div class="item"><span>7.围长:</span><input name="em6" type="text" value="{$examMeasure.em6}" placeholder="大转子(mm)" ></div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 30%">—— 左右径 ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px"><span>8.左右径:</span><input name="em7" type="text" value="{$examMeasure.em7}" placeholder="腋窝(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>9.左右径:</span><input name="em8" type="text" value="{$examMeasure.em8}" placeholder="乳头连线(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>10.左右径:</span><input name="em9" type="text" value="{$examMeasure.em9}" placeholder="剑突(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>11.左右径:</span><input name="em10" type="text" value="{$examMeasure.em10}" placeholder="肋骨下沿(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>12.左右径:</span><input name="em11" type="text" value="{$examMeasure.em11}" placeholder="腰部(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>13.左右径:</span><input name="em12" type="text" value="{$examMeasure.em12}" placeholder="髂前上棘(mm)" ></div>
            <div class="item"><span>14.左右径:</span><input name="em13" type="text" value="{$examMeasure.em13}" placeholder="大转子(mm)" ></div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 30%">—— 前后径 ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px"><span>15.前后径:</span><input name="em14" type="text" value="{$examMeasure.em14}" placeholder="腋窝(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>16.前后径:</span><input name="em15" type="text" value="{$examMeasure.em15}" placeholder="乳头连线(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>17.前后径:</span><input name="em16" type="text" value="{$examMeasure.em16}" placeholder="剑突(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>18.前后径:</span><input name="em17" type="text" value="{$examMeasure.em17}" placeholder="肋骨下沿(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>19.前后径:</span><input name="em18" type="text" value="{$examMeasure.em18}" placeholder="腰部(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>20.前后径:</span><input name="em19" type="text" value="{$examMeasure.em19}" placeholder="髂前上棘(mm)" ></div>
            <div class="item"><span>21.前后径:</span><input name="em20" type="text" value="{$examMeasure.em20}" placeholder="大转子(mm)" ></div>

            <div class="item" style="border-bottom:0px"><span>髂脊到腋下高度:</span><input name="em21" type="text" value="{$examMeasure.em21}" placeholder="高度(mm)" ></div>
            <div class="item" style="border-bottom:0px"><span>髂脊到大转子高度:</span><input name="em22" type="text" value="{$examMeasure.em22}" placeholder="高度(mm)" ></div>
            <div class="item">
                <span>其他测量描述：</span>
                <textarea class="t-area" name="other" maxlength="60" placeholder="请输入">{$examMeasure.other}</textarea>
            </div>

            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 20%">—— Cobb角（左凸、右凸） ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px">
                <span>上胸段:</span>
                <php>
                    $em23Name = $formDict["leftorright_".$examMeasure["em23"]];
                </php>
                <input id="em23" type="text" value="{$em23Name}" readonly placeholder="请选择">
                <select name="em23">
                    <option value="{$examMeasure.em23}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em23'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px"><span></span><input name="em24" type="text" value="{$examMeasure.em24}" placeholder="角度(°)" ></div>
            <div class="item" style="border-bottom:0px">
                <span>胸段:</span>
                <php>
                    $em25Name = $formDict["leftorright_".$examMeasure["em25"]];
                </php>
                <input id="em25" type="text" value="{$em25Name}" readonly placeholder="请选择">
                <select name="em25">
                    <option value="{$examMeasure.em25}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em25'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px"><span></span><input name="em26" type="text" value="{$examMeasure.em26}" placeholder="角度(°)" ></div>
            <div class="item" style="border-bottom:0px">
                <span>胸腰段:</span>
                <php>
                    $em27Name = $formDict["leftorright_".$examMeasure["em27"]];
                </php>
                <input id="em27" type="text" value="{$em27Name}" readonly placeholder="请选择">
                <select name="em27">
                    <option value="{$examMeasure.em27}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em27'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px"><span></span><input name="em28" type="text" value="{$examMeasure.em28}" placeholder="角度(°)" ></div>
            <div class="item" style="border-bottom:0px">
                <span>腰段:</span>
                <php>
                    $em29Name = $formDict["leftorright_".$examMeasure["em29"]];
                </php>
                <input id="em29" type="text" value="{$em29Name}" readonly placeholder="请选择">
                <select name="em29">
                    <option value="{$examMeasure.em29}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em29'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item"><span></span><input name="em30" type="text" value="{$examMeasure.em30}" placeholder="角度(°)" ></div>

            <div class="item" style="border-bottom:0px">
                <span class="itemTitle" style="margin-left: 20%">—— 剃刀背（左高、右高） ——</span><br/>
            </div>
            <div class="item" style="border-bottom:0px">
                <span>上胸段:</span>
                <php>
                    $em31Name = $formDict["leftorright_".$examMeasure["em31"]];
                </php>
                <input id="em31" type="text" value="{$em31Name}" readonly placeholder="请选择">
                <select name="em31">
                    <option value="{$examMeasure.em31}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em31'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px"><span></span><input name="em32" type="text" value="{$examMeasure.em32}" placeholder="角度(°)" ></div>
            <div class="item" style="border-bottom:0px">
                <span>胸段:</span>
                <php>
                    $em33Name = $formDict["leftorright_".$examMeasure["em33"]];
                </php>
                <input id="em33" type="text" value="{$em33Name}" readonly placeholder="请选择">
                <select name="em33">
                    <option value="{$examMeasure.em33}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em33'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px"><span></span><input name="em34" type="text" value="{$examMeasure.em34}" placeholder="角度(°)" ></div>
            <div class="item" style="border-bottom:0px">
                <span>胸腰段:</span>
                <php>
                    $em35Name = $formDict["leftorright_".$examMeasure["em35"]];
                </php>
                <input id="em35" type="text" value="{$em35Name}" readonly placeholder="请选择">
                <select name="em35">
                    <option value="{$examMeasure.em35}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em35'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item" style="border-bottom:0px"><span></span><input name="em36" type="text" value="{$examMeasure.em36}" placeholder="角度(°)" ></div>
            <div class="item" style="border-bottom:0px">
                <span>腰段:</span>
                <php>
                    $em37Name = $formDict["leftorright_".$examMeasure["em37"]];
                </php>
                <input id="em37" type="text" value="{$em37Name}" readonly placeholder="请选择">
                <select name="em37">
                    <option value="{$examMeasure.em37}">请选择</option>
                    {:getFormDictSelectOptionHtml($examMeasure['em37'],'leftorright','exam_measure_common',0)}
                </select>
                <img class="icon-right" src="/Template/images/icon-right.png" alt="">
            </div>
            <div class="item"><span></span><input name="em38" type="text" value="{$examMeasure.em38}" placeholder="角度(°)" ></div>

            <div class="item">
                <span>备注：</span>
                <textarea class="t-area" name="note" maxlength="60" placeholder="请输入">{$examMeasure.note}</textarea>
            </div>
            <div class="item" style="border-bottom:0px">
                <span class="itemTitle"></span>
            </div>

            <!--<div class="line"></div>-->
        </div>
    </div>
    <div class="operation-btn">
        <div class="cancle-btn" v-on:click="cancel">取消</div>
        <if condition="$workorder['status'] eq '-1' && $workorder['creator_id'] eq $customerId">
            <div class="save-btn" v-on:click="save">保存</div>
        </if>
        <if condition="$workorder['status'] eq '2' && $workorder['examinator_id'] eq $customerId && $workorder['exam_time'] eq ''">
            <div class="save-btn" v-on:click="save">保存</div>
        </if>
        <div v-if="{$workorder.status} >= 1 && checkRole('{$role}', '1')">
            <div class="save-btn" v-on:click="save">保存</div>
        </div>
    </div>

</div>
<include file="./Template/footer.html" />